package bitmapdata
{
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	import flash.display.Sprite;
	import flash.filters.BlurFilter;
	import flash.geom.Point;
	import flash.geom.Rectangle;
	import util.AssetsManager;
	
	public class TestApplyFilter extends Sprite
	{
		private var sourceBmd:BitmapData;
		private var canvas:Bitmap;
		
		public function TestApplyFilter()
		{
			test1();
		}
		
		public function test():void {
			sourceBmd = new BitmapData(100,100,true,0xffff0000);
			canvas = new Bitmap(sourceBmd);
			
			this.addChild(canvas);
			
			var bmd:BitmapData = new BitmapData(100,100,true,0xfffff000);
			sourceBmd.applyFilter(bmd,new Rectangle(0,0,50,50),new Point(),new BlurFilter(10,10,2));
		}
		
		public function test1():void {
			sourceBmd = AssetsManager.getResource("img.png");
			canvas = new Bitmap(sourceBmd);
			
			this.addChild(canvas);
			
			var bmd:BitmapData = new BitmapData(100,100,true,0xfffff000);
			sourceBmd.applyFilter(bmd,new Rectangle(0,0,50,50),new Point(),new BlurFilter(10,10,2));
		}
	}
}